import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class TimestampCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'timestamp'
        command.component = 'TimestampCommandComponent'

        return new TimestampCommand(command, false)
    }

    usage(): string {
        return 'timestamp [--sub] [-y 年] [-M 月] [-d 日] [-h 时] [-m 分] [-s 秒] [-p YYYY-mm-dd[ HH:MM:SS]] [--mil|--mic]'
    }

    description(): string {
        return `<div>处理时间戳</div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">--sub</span><span>减去指定的年月日时分秒</span></div>
        <div class="option-row"><span class="option-option">-y --years</span><span>加减年份</span></div>
        <div class="option-row"><span class="option-option">-M --months</span><span>加减月份</span></div>
        <div class="option-row"><span class="option-option">-d --days</span><span>加减日</span></div>
        <div class="option-row"><span class="option-option">-h --hours</span><span>加减小时</span></div>
        <div class="option-row"><span class="option-option">-m --minutes</span><span>加减分钟</span></div>
        <div class="option-row"><span class="option-option">-s --seconds</span><span>加减秒</span></div>
        <div class="option-row"><span class="option-option">-p --parse</span><span>从给定日期时间解析时间戳，格式为YYYY-mm-dd[ HH:MM:SS]，时分秒可选，若传入中间使用空格隔开</span></div>
        <div class="option-row"><span class="option-option">--mil</span><span>显示毫秒格式的时间戳</span></div>
        <div class="option-row"><span class="option-option">--mic</span><span>显示微秒格式的时间戳</span></div>`
    }
}
